/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author admin
 */
@Entity
@Table(name = "MARKA")
@XmlRootElement
@NamedQueries(
  {
    @NamedQuery(name = "Marka.findAll", query = "SELECT m FROM Marka m"),
    @NamedQuery(name = "Marka.findByIdMarkas", query = "SELECT m FROM Marka m WHERE m.idMarkas = :idMarkas"),
    @NamedQuery(name = "Marka.findByNameMarkas", query = "SELECT m FROM Marka m WHERE m.nameMarkas = :nameMarkas")
  })
public class Marka implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "ID_MARKAS")
    private Integer idMarkas;
    @Column(name = "NAME_MARKAS")
    private String nameMarkas;

    public Marka()
    {
    }

    public Marka(Integer idMarkas)
    {
        this.idMarkas = idMarkas;
    }

    public Integer getIdMarkas()
    {
        return idMarkas;
    }

    public void setIdMarkas(Integer idMarkas)
    {
        this.idMarkas = idMarkas;
    }

    public String getNameMarkas()
    {
        return nameMarkas;
    }

    public void setNameMarkas(String nameMarkas)
    {
        this.nameMarkas = nameMarkas;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (idMarkas != null ? idMarkas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Marka))
          {
            return false;
          }
        Marka other = (Marka) object;
        if ((this.idMarkas == null && other.idMarkas != null) || (this.idMarkas != null && !this.idMarkas.equals(other.idMarkas)))
          {
            return false;
          }
        return true;
    }

    @Override
    public String toString()
    {
        return "model.Marka[ idMarkas=" + idMarkas + " ]";
    }
    
}
